###########################
# Hucow related decisions #
###########################


decisions = {
	# Check hucow stats
	dwcm_check_hucow_stats = {
		potential = {
			ai = no # Only the player should ever see this
			trait = hucow
			is_female = yes
			age = 16
			has_character_flag = dwcm_hucow_variables_initialized
		}

		allow = {
			always = yes
		}

		effect = {
			character_event = { id = DWCMCore.2 }
		}

		ai_will_do = {
			factor = 0 # Zero chance the ai uses this
		}
	}


	# Resume research on Lacteria Mirifica
	dwcm_resume_lacteria_research = {
		potential = {
			# only_playable = yes
			ai = no # Only the player should ever see this
			NOT = { has_character_flag = dwcm_lacteria_research_aborted }
			OR = {
				has_character_flag = dwcm_lacteria_search_paused_01
				has_character_flag = dwcm_lacteria_search_paused_02
				has_character_flag = dwcm_lacteria_search_paused_03
			}
		}

		allow = {
			prisoner = no
			is_incapable = no
			OR = {
				has_valid_alchemist = yes # Calls a scripted_trigger from DW
				lf_has_potions = yes # LF
			}
		}

		effect = {
			if = {
				limit = {
					has_character_flag = dwcm_lacteria_search_paused_01
				}
				clr_character_flag = dwcm_lacteria_search_paused_01
				narrative_event = { id = DWCMHucow.100 }
				break = yes
			}
			if = {
				limit = {
					has_character_flag = dwcm_lacteria_search_paused_02
				}
				clr_character_flag = dwcm_lacteria_search_paused_02
				narrative_event = { id = DWCMHucow.110 }
				break = yes
			}
			if = {
				limit = {
					has_character_flag = dwcm_lacteria_search_paused_03
				}
				clr_character_flag = dwcm_lacteria_search_paused_03
				narrative_event = { id = DWCMHucow.140 }
			}
		}

		ai_will_do = {
			factor = 0 # Zero chance the ai uses this
		}
	}


	# test lactacid
	dwcm_test_lactacid = {
		potential = {
			has_character_flag = dwcm_lactacid_stored
		}

		allow = {
			prisoner = no
			is_incapable = no
		}

		effect = {
			clr_character_flag = dwcm_lactacid_stored
			set_character_flag = dwcm_lactacid_tested_by_decision
			narrative_event = { id = DWCMHucow.150 }
		}
	}
}

targetted_decisions = {

	# Self milking
	dwcm_hucow_milking = {
		filter = self
		ai_check_interval = 1

		potential = {
			prisoner = no
			trait = hucow
			is_female = yes
			has_character_flag = dwcm_hucow_variables_initialized
			age = 16
		}

		allow = {
			prisoner = no
			is_incapable = no
			NOT = { has_character_modifier = recently_milked }
			check_variable >= { which = dwcm_milk_quantity_CURRENT value = 0.5 }
		}

		effect = {
			character_event = { id = DWCMMilk.040 }
		}

		ai_will_do = {
			factor = 0.05
			modifier = { # Those who have engorged breasts are far more likely to milk themselve
				factor = 5
				trait = engorged_breasts
			}
			modifier = { # Those religious or chaste may be reluctant to milk themselve
				factor = 0.5
				trait = chaste
				trait = celibate
				trait = nun
				trait = zealous
			}
		}
	}
}